package com.yserp.project.erp.order.productorder.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yserp.framework.aspectj.lang.annotation.Excel;
import com.yserp.framework.web.domain.BaseEntity;
import com.yserp.project.erp.common.anno.MybatisLikeSearch;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 生产单 erp_production_order
 *
 * @author yserp
 * @date 2022-07-19
 */
@TableName("erp_production_order")
@Data
public class ProductionOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId
    private Long id;

    /**
     * 批次号
     */
    @Excel(name = "批次号")
    @MybatisLikeSearch
    private String batchNo;

    /**
     * 订单号
     */
    @Excel(name = "订单号")
    @MybatisLikeSearch
    private String orderNo;

    /**
     * 订单时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单时间" , width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderDate;

    /**
     * 要求完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "要求完成时间" , width = 30, dateFormat = "yyyy-MM-dd")
    private Date requiredDate;


    /**
     * 预期完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预期完成时间" , width = 30, dateFormat = "yyyy-MM-dd")
    private Date planDate;


    /**
     * 销售订单ID
     */
    private Long saleOrderId;

    /**
     * 销售订单编号
     */
    @Excel(name = "销售订单编号")
    @MybatisLikeSearch
    private String saleOrderNo;

    /**
     * 客户ID
     */
    private Long customerId;

    /**
     * 客户名称
     */
    @Excel(name = "客户名称")
    private String customerName;

    /**
     * 商品Id
     */
    private Long goodsId;

    /**
     * 商品编码
     */
    private String goodsCode;

    @Excel(name = "商品名称")
    private String goodsName;

    /**
     * 商品单位
     */
    private String goodsUnit;

    @Excel(name = "商品单位")
    private String goodsUnitDesc;

    @Excel(name = "商品数量")
    private BigDecimal goodsNum;

    @Excel(name = "入库数量")
    private BigDecimal inNum;

    @Excel(name = "订单审核状态", readConverterExp = "0=待审核,1=已审核")
    private String orderStatus;

    /**
     * 生产批次状态
     */
    @Excel(name = "生产批次状态", readConverterExp = "0=待生产,1=生产中,2=已生产")
    private String productStatus;

    @Excel(name = "入库状态",readConverterExp = "10=待入库,11=已入库")
    private String deliveryStatus;

    /**
     * 生产优先级
     */
    @Excel(name = "生产优先级",readConverterExp = "1=一般,2=紧急")
    private String batchPriority;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    private String delFlag;

}
